home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / KF_CODER.ZIP / JFC.PAS < prev   
Pascal/Delphi Source File  |  1995-09-08  |  17KB  |  719 lines

  1. program Szyfrator;
  2.  
  3. uses Dos, Crt;
  4. var
  5.    p1           : string;
  6.  
  7.    Header  :record
  8.    HMet      :string[7];
  9.    HSum      :integer;
  10.    HRFile    :string[12];
  11.    FNumber   :integer;
  12.    end;
  13.  
  14.    _File     :record
  15.    FName     :NameStr;
  16.    FExt      :ExtStr;
  17.    FSize     :longint;
  18.    FPos      :longint;
  19.    IsLast    :boolean;
  20.    end;
  21.  
  22. procedure Help;
  23. var
  24. ch      :char;
  25. begin
  26. writeln('');
  27. writeln('');
  28. writeln(' JFC Coder is an encoder/decoder program which encrypts files');
  29. writeln(' using an original key based on entered keyword. The keyword itself');
  30. writeln(' is NOT stored in the coded file, therefore the Coder can''t percept');
  31. writeln(' whether one entered the right keyword or not. However, when a wrong');
  32. writeln(' keyword is entered the key based on it is also wrong, so the files');
  33. writeln(' which would be uncoded can''t be used and are as illegible as the coded ones.');
  34. writeln('');
  35. writeln('Basic commands (ver. 1.0):');
  36. writeln('');
  37. writeln('C(reate), syntax:');
  38. writeln(' jfc.exe c yourfile.jfc *.*');
  39. writeln(' Where yourfile.jfc is a name of a file containing coded files,');
  40. writeln('       *.* is a mask describing files to be coded, i.e. *.exe, *.txt,');
  41. writeln('       save.*, mytext.txt etc.');
  42. writeln('');
  43. writeln('E(xtract), syntax:');
  44. writeln(' jfc.exe e yourfile.jfc');
  45. writeln(' Where yourfile.jfc is a name of a .jfc file from which the Coder');
  46. writeln('       should extract coded files.');
  47. writeln('');
  48. write('Press any key to continue...');
  49. ch:=readkey;
  50. GotoXy(1,25);
  51. writeln('L(ist), syntax:                 ');
  52. writeln(' jfc.exe l yourfile.jfc');
  53. writeln(' Where yourfile.jfc is a name of a .jfc file which you want to list');
  54. writeln('');
  55. writeln('Comments:');
  56. writeln(' -- you don''t have to add .jfc extension - it''ll be added automagically.');
  57. writeln(' -- try coding a text file and then extracting it with a wrong keyword to');
  58. writeln('    see what would happen.');
  59. writeln('');
  60. halt;
  61. end;
  62.  
  63.  
  64. procedure CreateIt;
  65.  
  66. label 1,2,3,4,5;
  67.  
  68. var
  69.    a,FNumber,b  :integer;
  70.    cf,df,ef     :file;
  71.    i            :longint;
  72.    P,P2,S,X     :PathStr;
  73.    D,curd,DIRKA :DirStr;
  74.    N            :NameStr;
  75.    E            :ExtStr;
  76.  
  77.    SR           :SearchRec;
  78.  
  79.    K1           :string[10];
  80.    CKey         :array[1..10] of byte;
  81.  
  82.    T,cr            :char;
  83.    EndLoop,jfc  :boolean;
  84.    copyb        :array[1..10000] of byte;
  85.  
  86. begin
  87.  
  88.    Header.HSum:=0;
  89.  
  90.    if (paramstr(2)='') then
  91.    begin
  92.       writeln('');
  93.       writeln('ERROR#01: Required parameter missing');
  94.       writeln('');
  95.       Help;
  96.    end;
  97.  
  98.    P:=paramstr(2);
  99.    X:=paramstr(3);
  100.  
  101.    FSplit(P,D,N,E);
  102.    GetDir(0,curd);
  103.    E:='.JFC';
  104.    D:=Curd;
  105.    P:=N+E;
  106.  
  107.    FSplit(X,D,N,E);
  108.    GetDir(0,curd);
  109.    S:=FSearch(D+P,curd);
  110.  
  111.    if S<>'' then
  112.    begin
  113.       writeln('');
  114.       writeln('ERROR#02: File already exists');
  115.        gotoxy(15,wherey);
  116.       write('Overwrite?[Y,N] ');
  117.       readln(cr);
  118.       if Upcase(cr)='Y' then
  119.       begin
  120.       gotoxy(15,wherey-1); write('                    ');
  121.       gotoxy(15,wherey);
  122.       end
  123.       else
  124.       begin
  125.       halt;
  126.       end;
  127.    end;
  128.  
  129.    assign(cf,P);
  130.    {$I-} rewrite(cf,1); {$I-}
  131.    if (IOResult<>0) then
  132.    begin
  133.       writeln('');
  134.       writeln('ERROR#03: Unrecognized I/O error');
  135.       writeln('');
  136.       halt;
  137.    end;
  138.  
  139.  
  140.  
  141.  
  142.    1:
  143.    for i:=1 to 10 do K1[i]:=chr(0);
  144.    writeln('');
  145.    write('Enter code keyword (up to 10 chars): ');
  146.    readln(K1);
  147.    Header.Hsum:=0;
  148.    for i:=1 to 10 do Header.HSum:=Header.HSum+ord(K1[i]);
  149.  
  150.    Header.HMet:='JFCoded';
  151.  
  152.    for i:=1 to length(Header.HRFile) do begin Header.HRFile[i]:=UpCase(Header.HRFile[i]); end;
  153.  
  154.    for i:=1 to 12 do P[i]:=Upcase(P[i]);
  155.  
  156.    writeln('');
  157.    write('JFC name is '); HighVideo; write(P); LowVideo; writeln('.');
  158.    write('Keyword is ''');
  159.    HighVideo;
  160.    write(K1);
  161.    LowVideo;
  162.    writeln('''.');
  163.    2: write('Is this correct? [Y,N] ');
  164.    T:=readkey;
  165.    if (UpCase(T)<>'Y') and (Upcase(T)<>'N') then begin writeln(''); writeln('Enter [Y]es or [N]o'); goto 2; end
  166.    else writeln('');
  167.    if (UpCase(T)='N') then goto 1;
  168.  
  169.    Blockwrite(cf,Header,SizeOf(Header));
  170.  
  171.    for i:=1 to 10 do begin CKey[i]:=0; end;
  172.  
  173.    for i:=1 to Length(K1) do
  174.    begin
  175.    if ord(K1[i])/1=int(ord(K1[i])/1) then Ckey[i]:=1;
  176.    if ord(K1[i])/2=int(ord(K1[i])/2) then Ckey[i]:=2;
  177.    if ord(K1[i])/3=int(ord(K1[i])/3) then Ckey[i]:=3;
  178.    if ord(K1[i])/4=int(ord(K1[i])/4) then Ckey[i]:=4;
  179.    if ord(K1[i])/5=int(ord(K1[i])/5) then Ckey[i]:=5;
  180.    if ord(K1[i])/6=int(ord(K1[i])/6) then Ckey[i]:=6;
  181.    if ord(K1[i])/7=int(ord(K1[i])/7) then Ckey[i]:=7;
  182.    if ord(K1[i])/8=int(ord(K1[i])/8) then Ckey[i]:=8;
  183.    if ord(K1[i])/9=int(ord(K1[i])/9) then Ckey[i]:=9;
  184.    if ord(K1[i])/10=int(ord(K1[i])/10) then Ckey[i]:=10;
  185.    if ord(K1[i])/11=int(ord(K1[i])/11) then Ckey[i]:=11;
  186.    if ord(K1[i])/12=int(ord(K1[i])/12) then Ckey[i]:=12;
  187.    if ord(K1[i])/13=int(ord(K1[i])/13) then Ckey[i]:=13;
  188.    if ord(K1[i])/14=int(ord(K1[i])/14) then Ckey[i]:=14;
  189.    if ord(K1[i])/15=int(ord(K1[i])/15) then Ckey[i]:=15;
  190.    end;
  191.  
  192.  
  193.    if CKey[10]=0 then
  194.    begin
  195.    for i:=Length(K1)+1 to 10 do
  196.    begin
  197.    CKey[i]:=CKey[i-Length(K1)];
  198.    end;
  199.    end;
  200.  
  201.    {$I-} FindFirst(paramstr(3),Archive,SR); {$I+}
  202.    if doserror<>0 then
  203.    begin
  204.    writeln('');
  205.    writeln('ERROR#04: File not found!');
  206.    writeln('');
  207.    erase(cf);
  208.    halt;
  209.    end;
  210.  
  211.  
  212.    FSplit(SR.Name,DIRKA,_File.FName,_File.FExt);
  213.    if SR.Name=P then goto 4;
  214.  
  215.  
  216.  
  217.    for i:=1 to Length(_File.FName) do
  218.    begin
  219.    _File.FName[i]:=chr(Ord(_File.FName[i]) xor CKey[i]);
  220.    end;
  221.  
  222.    for i:=2 to Length(_File.FExt) do
  223.    begin
  224.    _File.FExt[i]:=chr(Ord(_File.FExt[i]) xor CKey[i]);
  225.    end;
  226.    _File.FExt[1]:='.';
  227.  
  228.    Assign(df,D+SR.Name);
  229.    reset(df,1);
  230.    _File.FSize:=FileSize(df);
  231.    close(df);
  232.  
  233.    4: Endloop:=false;
  234.    jfc:=false;
  235.    writeln('');
  236.    writeln('');
  237.    repeat
  238.    5: FindNext(SR);
  239.    FSplit(SR.Name,DIRKA,N,E);
  240.    if SR.Name=P then begin Sr.Name:='';jfc:=true; goto 5; end;
  241.    if doserror=18 then
  242.    begin
  243.    _File.IsLast:=true;
  244.    Blockwrite(cf,_File,SizeOf(_File));
  245.    jfc:=false;
  246.    EndLoop:=true;
  247.    end else begin
  248.    _File.IsLast:=false;
  249.    if jfc=false then Blockwrite(cf,_File,SizeOf(_File));
  250.    jfc:=false;
  251.    end;
  252.  
  253.    _File.FName:=N;
  254.    _File.FExt:=E;
  255.    for i:=1 to Length(_File.FName) do
  256.    begin
  257.    _File.FName[i]:=chr(Ord(_File.FName[i]) xor CKey[i]);
  258.    end;
  259.  
  260.    for i:=2 to Length(_File.FExt) do
  261.    begin
  262.    _File.FExt[i]:=chr(Ord(_File.FExt[i]) xor CKey[i]);
  263.    end;
  264.    _File.FExt[1]:='.';
  265.  
  266.    If (sr.NAME<>'') then Assign(df,D+SR.Name);
  267.    reset(df,1);
  268.    _File.FSize:=FileSize(df);
  269.    close(df);
  270.  
  271.    until EndLoop=true;
  272.    FNumber:=0;
  273.  
  274.    repeat
  275.  
  276.    i:=SizeOf(Header)+FNumber*SizeOf(_File);
  277.    seek(cf,i);
  278.  
  279.    Blockread(cf,_File,SizeOf(_File));
  280.  
  281.    {Decoding}
  282.        for i:=1 to Length(_File.FName) do
  283.        begin
  284.        _File.FName[i]:=chr(Ord(_File.FName[i]) xor CKey[i]);
  285.        end;
  286.  
  287.        for i:=2 to Length(_File.FExt) do
  288.        begin
  289.        _File.FExt[i]:=chr(Ord(_File.FExt[i]) xor CKey[i]);
  290.        end;
  291.  
  292.    {opening input file}
  293.    Assign(df,D+_File.FName+_File.FExt);
  294.    reset(df,1);
  295.  
  296.    write(_File.FName+_File.FExt);
  297.  
  298.    i:=FileSize(cf);
  299.    seek(cf,i);
  300.    a:=1;
  301.  
  302.    for i:=1 to _File.FSize div 10000 do
  303.    begin
  304.  
  305.    gotoxy(17,WhereY); write(i,'0kb');
  306.  
  307.    Blockread(df,copyb,SizeOf(copyb));
  308.    a:=1;
  309.    for b:=1 to 10000 do
  310.    begin
  311.    copyb[b]:=copyb[b] xor CKey[a];
  312.    a:=a+1;
  313.    if a=11 then a:=1;
  314.    end;
  315.    Blockwrite(cf,copyb,SizeOf(copyb));
  316.    end;
  317.  
  318.    if (_File.FSize mod 10000) <> 0 then
  319.    begin
  320.  
  321.    Blockread(df,copyb,_File.FSize mod 10000);
  322.    a:=1;
  323.    for b:=1 to _File.FSize mod 10000 do
  324.    begin
  325.    copyb[b]:=copyb[b] xor CKey[a];
  326.    a:=a+1;
  327.    if a=11 then a:=1;
  328.    end;
  329.    Blockwrite(cf,copyb,_File.FSize mod 10000);
  330.    end;
  331.  
  332.    gotoxy(17,WhereY); write(_File.FSize);
  333.    gotoxy(27,WHEREY); writeln(' bytes OK');
  334.  
  335.    3:
  336.    FNumber:=FNumber+1;
  337.  
  338.    close(df);
  339.  
  340.    until _File.IsLast=true;
  341.    seek(cf,0);
  342.    Header.FNumber:=FNumber;
  343.    BlockWrite(cf,Header,SizeOf(Header));
  344.    writeln('');
  345.    writeln('');
  346.    write(P,' succesfully created. Don''t forget your keyword! (');
  347.    HighVideo; write(K1); LowVideo; writeln(')');
  348.  
  349.    halt;
  350. end;
  351.  
  352. procedure ListIt;
  353. label 1;
  354. var
  355. cf,df         :file;
  356. checksum      :integer;
  357. K1            :string[10];
  358. Ckey          :array[1..10] of byte;
  359. P,S           :PathStr;
  360. D,curd        :DirStr;
  361. N             :NameStr;
  362. E             :ExtStr;
  363. cr            :char;
  364. EndLoop       :boolean;
  365. a,c,b         :integer;
  366. AllSize,
  367. skipto,i      :longint;
  368.  
  369. begin
  370. if (paramstr(2)='') then
  371.    begin
  372.       writeln('');
  373.       writeln('ERROR#01: Required parameter missing');
  374.       writeln('');
  375.       halt;
  376.    end;
  377. P:=paramstr(2);
  378. FSplit(P,D,N,E);
  379. E:='.JFC';
  380.  
  381. P:=D+N+E;
  382. Assign(cf,P);
  383.  
  384. GetDir(0,curd);
  385.    S:=FSearch(P,curd);
  386.  
  387.    if S='' then
  388.    begin
  389.       writeln('');
  390.       writeln('ERROR#04: File not found!');
  391.       writeln('');
  392.       halt;
  393.    end;
  394. {$I-} reset(cf,1); {$I+}
  395. if (IOResult<>0) then
  396.    begin
  397.       writeln('');
  398.       writeln('ERROR#03: Unrecognized I/O error');
  399.       writeln('');
  400.       halt;
  401.    end;
  402. Blockread(cf,Header,SizeOf(Header));
  403. writeln('');
  404.    write('Enter code keyword for this file: ');
  405. for i:=1 to 10 do K1[i]:=chr(0);
  406.    readln(K1);
  407. writeln('');
  408.    checksum:=0;
  409.  
  410.    for b:=1 to Length(K1) do
  411.    begin
  412.    checksum:=checksum+ord(K1[b]);
  413.    end;
  414.  
  415.  
  416.    if (checksum<>Header.HSum) then
  417.    begin
  418.    Highvideo;
  419.    write('WARNING!!!'); Lowvideo;
  420.    writeln(' (#',checksum,' #',Header.HSum,')');
  421.    writeln('You have probably entered an incorrect keyword.');
  422.    write('Proceed anyway? ');
  423.    readln(Cr);
  424.    writeln('');
  425.    if Upcase(Cr)='N' then halt;
  426.    end;
  427.  
  428.    for i:=1 to 10 do begin CKey[i]:=0; end;
  429.  
  430.    for i:=1 to Length(K1) do
  431.    begin
  432.    if ord(K1[i])/1=int(ord(K1[i])/1) then Ckey[i]:=1;
  433.    if ord(K1[i])/2=int(ord(K1[i])/2) then Ckey[i]:=2;
  434.    if ord(K1[i])/3=int(ord(K1[i])/3) then Ckey[i]:=3;
  435.    if ord(K1[i])/4=int(ord(K1[i])/4) then Ckey[i]:=4;
  436.    if ord(K1[i])/5=int(ord(K1[i])/5) then Ckey[i]:=5;
  437.    if ord(K1[i])/6=int(ord(K1[i])/6) then Ckey[i]:=6;
  438.    if ord(K1[i])/7=int(ord(K1[i])/7) then Ckey[i]:=7;
  439.    if ord(K1[i])/8=int(ord(K1[i])/8) then Ckey[i]:=8;
  440.    if ord(K1[i])/9=int(ord(K1[i])/9) then Ckey[i]:=9;
  441.    if ord(K1[i])/10=int(ord(K1[i])/10) then Ckey[i]:=10;
  442.    if ord(K1[i])/11=int(ord(K1[i])/11) then Ckey[i]:=11;
  443.    if ord(K1[i])/12=int(ord(K1[i])/12) then Ckey[i]:=12;
  444.    if ord(K1[i])/13=int(ord(K1[i])/13) then Ckey[i]:=13;
  445.    if ord(K1[i])/14=int(ord(K1[i])/14) then Ckey[i]:=14;
  446.    if ord(K1[i])/15=int(ord(K1[i])/15) then Ckey[i]:=15;
  447.    end;
  448.  
  449.  
  450.    if CKey[10]=0 then
  451.    begin
  452.    for i:=Length(K1)+1 to 10 do
  453.    begin
  454.    CKey[i]:=CKey[i-Length(K1)];
  455.    end;
  456.    end;
  457.  
  458. AllSize:=0;
  459.    writeln('Contents of: ',N,E);
  460.    writeln('');
  461.  
  462.    for a:=1 to Header.FNumber do begin
  463.    i:=SizeOf(Header)+(a-1)*SizeOf(_File);
  464.    seek(cf,i);
  465.    Blockread(cf,_File,SizeOf(_File));
  466.    for i:=1 to Length(_File.FName) do
  467.    begin
  468.        _File.FName[i]:=chr(Ord(_File.FName[i]) xor CKey[i]);
  469.    end;
  470.  
  471.    for i:=2 to Length(_File.FExt) do
  472.    begin
  473.        _File.FExt[i]:=chr(Ord(_File.FExt[i]) xor CKey[i]);
  474.    end;
  475.    write(_File.FName,_File.FExt);
  476.    GotoXy(20,WhereY);
  477.    writeln(_File.FSize);
  478.    skipto:=Sizeof(Header)+Header.FNumber*SizeOf(_File)+AllSize;
  479.    seek(cf,SkipTo);
  480. 1: Allsize:=allsize+_File.FSize;
  481.    end;
  482. halt;
  483. end;
  484. procedure ExtractIt;
  485.  
  486. label 1;
  487.  
  488. var
  489. cf,df         :file;
  490. checksum      :integer;
  491. NowX,NowY     :byte;
  492. K1            :string[10];
  493. Ckey          :array[1..10] of byte;
  494. P,S           :PathStr;
  495. D,curd        :DirStr;
  496. N             :NameStr;
  497. E             :ExtStr;
  498. cr            :char;
  499. copyb         :array[1..10000] of byte;
  500. EndLoop       :boolean;
  501. a,c,b         :integer;
  502. AllSize,
  503. skipto,i      :longint;
  504. begin
  505. if (paramstr(2)='') then
  506.    begin
  507.       writeln('');
  508.       writeln('ERROR#01: Required parameter missing');
  509.       writeln('');
  510.       Halt;
  511.    end;
  512. P:=paramstr(2);
  513. FSplit(P,D,N,E);
  514. E:='.JFC';
  515.  
  516. P:=D+N+E;
  517. Assign(cf,P);
  518.  
  519. GetDir(0,curd);
  520.    S:=FSearch(P,curd);
  521.  
  522.    if S='' then
  523.    begin
  524.       writeln('');
  525.       writeln('ERROR#04: File not found!');
  526.       writeln('');
  527.       halt;
  528.    end;
  529. {$I-} reset(cf,1); {$I+}
  530. if (IOResult<>0) then
  531.    begin
  532.       writeln('');
  533.       writeln('ERROR#03: Unrecognized I/O error');
  534.       writeln('');
  535.       halt;
  536.    end;
  537. Blockread(cf,Header,SizeOf(Header));
  538. writeln('');
  539.    write('Enter code keyword for this file: ');
  540.    NowX:=WhereX;
  541.    NowY:=WhereY;
  542.    writeln('');
  543.    writeln(''); Highvideo;
  544.    write('WARNING!!!'); Lowvideo;
  545.    writeln(' If you enter a wrong keyword, JFC Coder will probably');
  546.    writeln('report an I/O error. If not, don''t try to run a file which');
  547.    writeln('would be uncoded -- you''d be lucky if your computer wouldn''t crash!');
  548.    Gotoxy(NowX,Wherey-5);
  549.  
  550.    for i:=1 to 10 do K1[i]:=chr(0);
  551.    readln(K1);
  552.    for i:=1 to 4*80 do begin write(' '); end;
  553.    gotoxy(NowX,Wherey-4);
  554.    writeln('');
  555.    writeln('');
  556.    checksum:=0;
  557.  
  558.    for b:=1 to Length(K1) do
  559.    begin
  560.    checksum:=checksum+ord(K1[b]);
  561.    end;
  562.  
  563.  
  564.    if (checksum<>Header.HSum) then
  565.    begin
  566.    Highvideo;
  567.    write('WARNING!!!'); Lowvideo;
  568.    writeln(' (#',checksum,' #',Header.HSum,')');
  569.    writeln('You have probably entered an incorrect keyword.');
  570.    write('Proceed anyway? ');
  571.    readln(Cr);
  572.    writeln('');
  573.    if Upcase(Cr)='N' then halt;
  574.    end;
  575.  
  576.    for i:=1 to 10 do begin CKey[i]:=0; end;
  577.  
  578.    for i:=1 to Length(K1) do
  579.    begin
  580.    if ord(K1[i])/1=int(ord(K1[i])/1) then Ckey[i]:=1;
  581.    if ord(K1[i])/2=int(ord(K1[i])/2) then Ckey[i]:=2;
  582.    if ord(K1[i])/3=int(ord(K1[i])/3) then Ckey[i]:=3;
  583.    if ord(K1[i])/4=int(ord(K1[i])/4) then Ckey[i]:=4;
  584.    if ord(K1[i])/5=int(ord(K1[i])/5) then Ckey[i]:=5;
  585.    if ord(K1[i])/6=int(ord(K1[i])/6) then Ckey[i]:=6;
  586.    if ord(K1[i])/7=int(ord(K1[i])/7) then Ckey[i]:=7;
  587.    if ord(K1[i])/8=int(ord(K1[i])/8) then Ckey[i]:=8;
  588.    if ord(K1[i])/9=int(ord(K1[i])/9) then Ckey[i]:=9;
  589.    if ord(K1[i])/10=int(ord(K1[i])/10) then Ckey[i]:=10;
  590.    if ord(K1[i])/11=int(ord(K1[i])/11) then Ckey[i]:=11;
  591.    if ord(K1[i])/12=int(ord(K1[i])/12) then Ckey[i]:=12;
  592.    if ord(K1[i])/13=int(ord(K1[i])/13) then Ckey[i]:=13;
  593.    if ord(K1[i])/14=int(ord(K1[i])/14) then Ckey[i]:=14;
  594.    if ord(K1[i])/15=int(ord(K1[i])/15) then Ckey[i]:=15;
  595.    end;
  596.  
  597.  
  598.    if CKey[10]=0 then
  599.    begin
  600.    for i:=Length(K1)+1 to 10 do
  601.    begin
  602.    CKey[i]:=CKey[i-Length(K1)];
  603.    end;
  604.    end;
  605.  
  606.    AllSize:=0;
  607.  
  608.    for a:=1 to Header.FNumber do begin
  609.    i:=SizeOf(Header)+(a-1)*SizeOf(_File);
  610.    seek(cf,i);
  611.    Blockread(cf,_File,SizeOf(_File));
  612.    for i:=1 to Length(_File.FName) do
  613.    begin
  614.        _File.FName[i]:=chr(Ord(_File.FName[i]) xor CKey[i]);
  615.    end;
  616.  
  617.    for i:=2 to Length(_File.FExt) do
  618.    begin
  619.        _File.FExt[i]:=chr(Ord(_File.FExt[i]) xor CKey[i]);
  620.    end;
  621.    write(_File.FName,_File.FExt);
  622.  
  623.    skipto:=Sizeof(Header)+Header.FNumber*SizeOf(_File)+AllSize;
  624.    seek(cf,SkipTo);
  625.    Assign(df,_File.FName+_File.FExt);
  626.  
  627.    GetDir(0,curd);
  628.    S:=FSearch(_File.FName+_File.FExt,curd);
  629.  
  630.    if S<>'' then
  631.    begin
  632.       gotoxy(15,wherey);
  633.       write('Overwrite?[Y,N] ');
  634.       readln(cr);
  635.       if Upcase(cr)='Y' then
  636.       begin
  637.       gotoxy(15,wherey-1); write('                    ');
  638.       gotoxy(15,wherey);
  639.       end
  640.       else
  641.       begin
  642.       gotoxy(15,wherey-1); writeln('Skipped                ');
  643.       goto 1;
  644.       end;
  645.    end;
  646.  
  647.    {$I-} rewrite(df,1); {$I+}
  648.  
  649.    if (IOResult<>0) then
  650.    begin
  651.       writeln('');
  652.       writeln('');
  653.       writeln('ERROR#03: Unrecognized I/O error');
  654.       writeln('');
  655.       halt;
  656.    end;
  657.  
  658.  
  659.    for i:=1 to 10000 do copyb[i]:=0;
  660.  
  661.    for i:=1 to _File.FSize div 10000 do
  662.    begin
  663.    Blockread(cf,copyb,SizeOf(copyb));
  664.    gotoxy(15,wherey); write(i,'0kb');
  665.    c:=1;
  666.    for b:=1 to 10000 do
  667.    begin
  668.    copyb[b]:=copyb[b] xor CKey[c];
  669.    c:=c+1;
  670.    if c=11 then c:=1;
  671.    end;
  672.    Blockwrite(df,copyb,SizeOf(copyb));
  673.    end;
  674.  
  675.    if (_File.FSize mod 10000)<>0 then
  676.    begin
  677.    Blockread(cf,copyb,_File.FSize mod 10000);
  678.    c:=1;
  679.    for b:=1 to _File.FSize mod 10000 do
  680.    begin
  681.    copyb[b]:=copyb[b] xor CKey[c];
  682.    c:=c+1;
  683.    if c=11 then c:=1;
  684.    end;
  685.    Blockwrite(df,copyb,_File.FSize mod 10000);
  686.    end;
  687.    gotoxy(15,wherey); writeln(_File.FSize);
  688.  
  689.  
  690.    1: Allsize:=allsize+_File.FSize;
  691.    end;
  692. writeln('');
  693. for i:=1 to length(P) do P[i]:=UpCase(P[i]);
  694. writeln(P,' succesfully uncoded.');
  695.  
  696. halt;
  697. end;
  698.  
  699.  
  700. begin
  701.  
  702.    p1:=paramstr(1);
  703.    writeln(#10,#13,#10,#13, 
  704.       'JFC Coder Version 1.0, written by Kuba Fast 1993-94.');
  705.  
  706.    if (p1<>'?') and (p1<>'/?') then writeln('Use ''jfc /?'' for help.');
  707.  
  708.    if (p1='C') or (p1='c') then CreateIt;
  709.    if (p1='L') or (p1='l') then ListIt;
  710.    if (p1='E') or (p1='e') then ExtractIt;
  711.    if (p1='?') or (p1='/?') or (p1='-?') then Help;
  712.  
  713.  
  714.    writeln('');
  715.    writeln('ERROR#01: Required parameter missing');
  716.    writeln('');
  717.  
  718. end.
  719.